home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 6
/
The Arsenal Files 6 (Arsenal Computer).ISO
/
prg_basi
/
n_b-v200.zip
/
NBT1
/
DMO
/
TPRNTLEN.DMO
< prev
next >
Wrap
Text File
|
1996-03-11
|
2KB
|
41 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME TPRNTLEN.DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
$INCLUDE "DAS-NBT1.INC"
COLOR 7, 0
CLS
? "┌───────────────────────────────────────────────────────────────────────
? "│ fTprintLEN% ( V$, MidPos% )
? "├─────────────────────────────────────────────────────────────────────────
? "│ As Tprint and family accept embedded attribute commands their length may
? "│ not be their actual 'visual length'. This function returns that length.
? "├────────────────────────────────────────────────────────────────────────────
? "│ Test$ contains 2 triggers () but the first of the two is followed by yet
? "│ another trigger so only 1 trigger is printed and the attribute remains the
? "│ same. The third and the following 'Å' change the attribute to 143
? "└─────────────────────────────────────────────────────────────────────────────
?
Test$ = "This isÅ a test." ' this is what we're working with
PRINT test$ ' PowerBASIC prints this
' produces 1 printed
Tprint 14, 1, Test$, 0 ' Tprint does this with the triggers
'
Tlen% = fTprintLEN%( Test$, 1 ) ' the visible length
M$ = USING$( "The visible length of Test$ is ## characters.", Tlen% )
Tprint 16, 1, M$, 0